/*
 * @Description: 用户信息状态管理
 * @Author: laoyuan
 * @Date: 2023-04-06 16:07:01
 */
import { defineStore } from 'pinia';

const useUserStore = defineStore('user', {
  state: () => {
    return {
      userName: 'laoyuan',
    };
  },
  getters: {
    userNameLength: state => state.userName.length,
  },
  actions: {
    updateUserName(name: string) {
      this.userName = name;
    },
  },
});

export default useUserStore;
